<?php
require_once("../config.php");
require_once(_SRC_."/dao/PageDao.php");
?>

<?php
	$pageDao = new PageDao();
	$pages = $pageDao->getPages();
	
	$action = $_GET["action"];
	
	if($action == "addPage"){
		$pages = json_decode($_REQUEST["pages"]);
		foreach($pages as $page){
			$pageDao->updatePage($page);
		}
	echo "<result status='success'></result>";
}else if($action == "deletePage"){
	$pageDao->deletePage($_REQUEST["id"]);
	echo "<result status='success'></result>";
}
?>